
public class Echo extends Thread {
	String message;
	int delay;
	public Echo(String message, int delay) {
		this.message = message;
		this.delay = delay;
	}
	
	public void run() {
		while(true) {
			System.out.println(message);
			try {
				Thread.sleep(this.delay);
			} catch(InterruptedException e) {
				break;
			}
			if(this.isInterrupted()) {
				break;
			}
		}
		System.out.println("Echo[" + message + "] terminated.");
	}
}
